<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('告警记录列表')" />
	<th:block th:include="include :: layout-latest-css" />
</head>
<body class="gray-bg">
	<div class="container-div ui-layout-center">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="station-element-data-form">
					<div class="select-list">
						<ul>
							<li>
								泵站名称：<input type="text" name="stationName"/>
							</li>
							<li>
								组件类型：<select name="elementType" th:with="type=${@dict.getType('biz_se_type')}">
									<option value="">所有</option>
									<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
								</select>
							</li>
							<li class="select-time">
								<label>时间： </label>
								<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
								<span>-</span>
								<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
							    <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
	        <div class="btn-group-sm" id="toolbar" role="group">
	            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="biz:stationElement:dataExport">
		            <i class="fa fa-download"></i> 导出
		        </a>
	        </div>
	        
	        <div class="col-sm-12 select-table table-striped">
			    <table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
	
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: layout-latest-js" />
	<script th:inline="javascript">
	     var jcptypes = [[${@dict.getType('biz_se_type')}]];
	     var liquidLevels = [[${@dict.getType('biz_liquid_level')}]];
	
		var prefix = ctx + "biz/stationElement/data";

		$(function() {
		    var panehHidden = false;
		    if ($(this).width() < 769) {
		        panehHidden = true;
		    }
		    $('body').layout({ initClosed: panehHidden, west__size: 185 });
		    queryStationDataList();
		});

		function queryStationDataList() {
		    var options = {
		        url: prefix + "/dataList",
		        exportUrl: prefix + "/dataExport",
		        /* sortName: "createTime",
		        sortOrder: "desc", */
		        modalName: "泵站组件数据",
		        columns: [{
		            checkbox: true
		        },
		        {
		            field: 'id',
		            title: '记录ID'
		        },
		        {
		            field: 'stationName',
		            title: '泵站名称'
		        },
		        {
		            field: 'elementType',
		            title: '组件类型',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	return $.table.selectDictLabel(jcptypes, value);
		            }
		        },
		        {
		            field: 'serialNumber',
		            title: '组件编号'
		        },
		        {
		            field: 'temperature',
		            title: '水温'
		        },
		        {
		            field: 'turbidity',
		            title: '浊度'
		        },
		        {
		            field: 'phValue',
		            title: '酸碱度'
		        },
		        {
		            field: 'residualChlorine',
		            title: '余氯'
		        },
		        {
		            field: 'velocity',
		            title: '流速'
		        },
		        {
		            field: 'pressure',
		            title: '压力'
		        },
		        {
		            field: 'liquidLevel',
		            title: '水库液位',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	return $.table.selectDictLabel(liquidLevels, value);
		            }
		        },
		        {
		            field: 'createTime',
		            title: '创建时间',
		            sortable: false
		        }]
		    };
		    $.table.init(options);
		}
		
	</script>
</body>
</html>